<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>杨青青个人博客</title>
<link href="/static/homeconfig/css/base.css" rel="stylesheet">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<script src="/static/homeconfig/js/jquery.js"></script>
<script src="/static/homeconfig/js/nav.js"></script>
  <style>
    .artic2{
      display: flex;
      flex-direction: row;
      width: 400px;
      justify-content: space-around;
    }
    .artic2 div{
      display: flex;
      flex-direction: row;
    }
    .artic2 div img{
      margin-right: 5px;
      width: 18px;
      height: 18px;
    }
  </style>
</head>
<body>
<!--header end-->
{include file="index/header"}
<!--header end-->
<main>
  <p class="weizhi">您现在的位置是：<a href="/" target="_blank">网站首页</a>><a href="/" target="_blank">博客日记</a></p>
  <article>
    <div class="container">
      <h1>{$date.title}</h1>
      <p class="blog_info">
        <span>{$date.pubdate}</span>
        <span>{$date.author}</span>
        <span><a href="" target="_blank">{$date.catename}</a></span>
        <span>{$date.clicks}</span>
        {if condition="$date.id eq $date.artid"}
          <span style="background:url(/static/images/like1.png)  no-repeat;background-size: 18px" onclick="xihuan(this,0,{$date.id},{$date.artid})">{$date.favs}</span>
        {else/}
          <span style="background:url(/static/images/like.png) no-repeat;background-size: 18px" onclick="xihuan(this,1,{$date.id},{$date.artid})">{$date.favs}</span>
        {/if}
      </p>
      <div class="tags">
        {foreach name="label" id="lab"}
        <a href="" target="_blank">{$lab}</a>
        {/foreach}
      </div>
      <div class="content">
        {$date.content|raw}
      </div>
      <div class="info-pre-next">
        {if condition="$prepage.title eq null"}
        <p><span>上一篇</span><a href="{:url('info')}?titleid={$date.id}">已经是最顶了</a></p>
        {else/}
        <p><span>上一篇</span><a href="{:url('info')}?titleid={$prepage.id}">{$prepage.title}</a></p>
        {/if}

        {if condition="$nextpage.title eq null"}
        <p><span>下一页</span><a href="{:url('info')}?titleid={$date.id}">啊偶，到底了呢~</a></p>
        {else/}
        <p><span>下一页</span><a href="{:url('info')}?titleid={$nextpage.id}">{$nextpage.title}</a></p>
        {/if}
      </div>
      <div class="otherlink">
        <h2>相关文章</h2>
        <ul>
          {foreach name="relevant" id="val"}
          <li><a href="{:url('info')}?titleid={$val.id}" >{$val.title}</a></li>
          {/foreach}
        </ul>
      </div>
      <div class="pinglun_box">
        <h2>文章评论</h2>
      </div>
    </div>
  </article>
  <!--article end-->
  
  <aside>
    <div class="search">
      <form action="/e/search/index.php" method="post" name="searchform" id="searchform">
        <input name="keyboard" id="keyboard" class="input_text" value="请输入关键字词" style="color: rgb(153, 153, 153);" onfocus="if(value=='请输入关键字词'){this.style.color='#000';value=''}" onblur="if(value==''){this.style.color='#999';value='请输入关键字词'}" type="text">
        <input name="show" value="title" type="hidden">
        <input name="tempid" value="1" type="hidden">
        <input name="tbname" value="news" type="hidden">
        <input name="Submit" class="input_submit" value="搜索" type="submit">
      </form>
    </div>
    <div class="tuijian">
      <h2 class="aside_title">站长推荐</h2>
      <ul>
        {foreach name="tuij" id="val"}
        <li><a href="{:url('info')}?titleid={$val.id}" target="_blank"><i><img src="{$val.thumb}" alt="标题图片"></i>
          <p>{$val.title}</p>
          </a></li>
        {/foreach}
      </ul>
    </div>
    <div class="love">
      <h2 class="aside_title">猜你喜欢</h2>
      <ul>
        <li><a href="/" target="_blank"><i><img src="/static/homeconfig/images/001.jpg" alt="标题图片"></i>
          <p>每个人的生命里都一定会有这么一个人，他告诉我们什么是爱</p>
          </a></li>
        <li><a href="/" target="_blank"><i><img src="/static/homeconfig/images/002.png" alt="标题图片"></i>
          <p>人生就是越努力越幸运！</p>
          </a></li>
        <li><a href="/" target="_blank"><i><img src="/static/homeconfig/images/003.jpg" alt="标题图片"></i>
          <p>『旅行游记』假如你厌倦了现状,那就去云南吧</p>
          </a></li>
        <li><a href="/" target="_blank"><i><img src="/static/homeconfig/images/004.jpg" alt="标题图片"></i>
          <p>追梦路上邂逅爱情,他们携手改写平凡人生!</p>
          </a></li>
        <li><a href="/" target="_blank"><i><img src="/static/homeconfig/images/005.jpg" alt="标题图片"></i>
          <p>遇见你,是我平凡人生中最美的事情</p>
          </a></li>
        <li><a href="/" target="_blank"><i><img src="/static/homeconfig/images/006.jpg" alt="标题图片"></i>
          <p>人生就是越努力越幸运！</p>
          </a></li>
      </ul>
    </div>
    <div class="tagsclous">
      <h2 class="aside_title">标签云</h2>
      <ul>
        {foreach name="labyun" id="yun"}
        <a href="">
        <p>{$yun.l_name }</p>
        </a>
        {/foreach}
      </ul>
    </div>
  </aside>
  <!--aside end--> 
</main>
<!--footer end-->
{include file="index/footer"}
<!--footer end-->
<script>
  function xihuan(obj,date,id,colid) {
    $date={
      shu:date,
      id:id,
      colid:colid
    }
    $.ajax({
      url:"{:url('do_like')}",
      data:$date,
      type:'post',
      success:function (res) {
          if(res.zt==1){
            $(obj).removeAttr('onclick');
            $(obj).attr('onclick','xihuan(this,1,'+id+','+colid+')');
            $(obj).css('background-image','url(/static/images/like.png)');
            $(obj).text(res.val-1);
          }else{
            $(obj).removeAttr('onclick');
            $(obj).attr('onclick','xihuan(this,0,'+id+','+colid+')');
            $(obj).css('background-image','url(/static/images/like1.png)');
            $(obj).text(res.val+1);
          }
      }
    })
  }
</script>
</body>
</html>
